from flask import  Flask,render_template,redirect

app = Flask(__name__)

"""
特殊装饰器
before_request = [xxx1,xxx2]
"""

@app.before_request
def xxx1():
    print("前1")

@app.before_request
def xxx2():
    print("前2")

"""
after_request = [xxxxxx1,xxxxxx2]
"""

@app.after_request
def xxxxxx1(response):
    print("后1")
    return response

@app.after_request
def xxxxxx2(response):
    print("后2")
    return response

@app.route('/x1',methods=['GET','POST'])
def x1():
    print("视图函数x1")
    return "视图函数x2"

@app.route('/x2',methods=['GET','POST'])
def x2():
    print("视图函数x2")
    return "视图函数x2"

if __name__=="__main__":
    app.run()
